﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="BSCMFF.Web.Pages.test" %>
<%@ Register TagPrefix="more" TagName="pici" Src="~/UserControls/RadGridItemButtons.ascx" %>
<%--<%@ Register TagPrefix="more" TagName="emp" Src="~/UserControls/SelectEmployer.ascx" %>--%>
<%@ Register TagPrefix="more" TagName="emp2" Src="~/UserControls/EmployerSelection.ascx" %>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<telerik:RadListView ID="RadListView1"  runat="server"
                            ItemPlaceholderID="CustomersContainer" 
        DataKeyNames="ID" DataSourceID="EntityDataSource1"
                            >
                            <LayoutTemplate>
                                <!-- Set the id of the wrapping container to match the CLIENT ID of the RadListView control to display the ajax loading panel
                         In case the listview is embedded in another server control, you will need to append the id of that server control -->
                                <fieldset id="FiledSet1">
                                    <legend>Customers</legend>
                                   
                                    <asp:PlaceHolder ID="CustomersContainer" runat="server" />
                                    <div style="clear: both" />
                                    <br />
                                    <br />
                                    <table style="width: 100%;">
                                        <tr>
                                            <td style="width: 25%;">
                                                <asp:Button ID="btnInitInsert" runat="server" Text="Insert Customer"  />
                                            </td>
                                            <td style="text-align: right; width: 75%;">
                                                <asp:Label ID="lblSort1" runat="server" Text="Sort by:" Style="padding-right: 5px;" />
                                                <telerik:RadComboBox ID="ddListSort" runat="server" AutoPostBack="true" >
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="-Select field to sort-" Value="" />
                                                        <telerik:RadComboBoxItem Text="Company name" Value="CompanyName" />
                                                        <telerik:RadComboBoxItem Text="Contact name" Value="ContactName" />
                                                        <telerik:RadComboBoxItem Text="Title" Value="ContactTitle" />
                                                        <telerik:RadComboBoxItem Text="City" Value="City" />
                                                        <telerik:RadComboBoxItem Text="Country" Value="Country" />
                                                        <telerik:RadComboBoxItem Text="Clear sort" Value="ClearSort" />
                                                    </Items>
                                                </telerik:RadComboBox>
<asp:RadioButtonList RepeatLayout="Flow" RepeatDirection="Horizontal" ID="rblSort"
runat="server" AutoPostBack="true" >
                                                    <asp:ListItem Text="Ascending" Value="ASC" Selected="True" />
                                                    <asp:ListItem Text="Descending" Value="DESC" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
                             in the tiles layout-->
                                <fieldset style="float: left; width: 370px; height: 185px;">
                                    <legend>Login:
                                        <%# Eval("Login") %></legend>
                                    <table cellpadding="0" cellspacing="0" style="height: 100%;" width="370px">
                                        <tr>
                                            <td>
                                                <table cellpadding="0" cellspacing="0">
                                                    <tr>
                                                        <td>
                                                            <table cellpadding="0" cellspacing="0">
                                                                <tr>
                                                                    <td style="width: 25%">
                                                                        Name:
                                                                    </td>
                                                                    <td style="width: 50%">
                                                                        <%#Eval("Login")%>
                                                                    </td>
                                                                </tr>
                                                                
                                                            </table>
                                                        </td>
                                                        <td align="right" style="width: 30%; padding-left: 10px;">
                                                            <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="Contact Photo"
                                                                ToolTip="Contact Photo" Width="90px" Height="110px" ResizeMode="Fit" DataValue='<%# Eval("Photo") %>' />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table style="width: 100%;">
                                                    <tr>
                                                        <td>
                                                            <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" Width="50px" />
                                                        </td>
                                                        <td style="text-align: right">
                                                            <asp:Button ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" Width="50px" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
                             in the tiles layout-->
                                <fieldset style="float: left; width: 370px; height: 185px;">
                                    <legend>Company name:
                                        <asp:TextBox ID="txtBoxCompanyName" runat="server" Text='<%#Bind("Login")%>' />
<asp:RequiredFieldValidator ID="rvCompanyName" runat="server" ControlToValidate="txtBoxCompanyName"
ErrorMessage="Please enter company name" Display="Dynamic" />
                                    </legend>
                                    <table cellpadding="0" cellspacing="0" style="width: 370px;">
                                        <tr>
                                            <td>
                                                <table cellpadding="0" cellspacing="0">
                                                    <tr>
                                                        <td>
                                                            <table cellpadding="0" cellspacing="2">
                                                                <tr>
                                                                    <td style="width: 25%">
                                                                        Name:
                                                                    </td>
                                                                    <td style="width: 75%">
                                                                        <asp:TextBox ID="txtBoxName" runat="server" Text='<%#Bind("Login")%>' />
<asp:RequiredFieldValidator ID="rvName" runat="server" ControlToValidate="txtBoxName"
ErrorMessage="Please enter name" Display="Dynamic" />
                                                                    </td>
                                                                </tr>
                                                               
                                                            </table>
                                                        </td>
                                                        <td align="right" style="width: 25%; padding-left: 10px;">
                                                            <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="Contact Photo"
                                                                ToolTip="Contact Photo" Width="90px" Height="110px" ResizeMode="Fit" DataValue='<%# Eval("Photo") %>' />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <div style="float: left; width: 160px;">
                                                    <asp:Button ID="btnUpdate" runat="server" Text="Update" CommandName="Update" />
                                                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false" />
                                                </div>
                                                <telerik:RadUpload ID="ruCustomerImage" runat="server" AllowedFileExtensions=".jpg,.jpeg,.gif,.png"
                                                    MaxFileSize="1000000" ControlObjectsVisibility="None" InputSize="12" Width="160px"
                                                    Style="float: right" />
                                                <div style="clear: both" />
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
                             in the tiles layout-->
                                <fieldset style="float: left; width: 370px; height: 200px;">
                                    <legend>Company name:
                                        <asp:TextBox ID="txtBoxCompanyName" runat="server" Text='<%# Bind("Login") %>' />
<asp:RequiredFieldValidator ID="rvCompanyName" runat="server" ControlToValidate="txtBoxCompanyName"
ErrorMessage="Please enter company name" Display="Dynamic" />
                                    </legend>
                                    <table cellpadding="0" cellspacing="0" style="width: 370px;">
                                        <tr>
                                            <td>
                                                <table cellpadding="0" cellspacing="5">
                                                    <tr>
                                                        <td style="width: 25%">
                                                            Name:
                                                        </td>
                                                        <td style="width: 75%">
                                                            <asp:TextBox ID="txtBoxName" runat="server" Text='<%# Bind("Login") %>' />
<asp:RequiredFieldValidator ID="rvName" runat="server" ControlToValidate="txtBoxName"
ErrorMessage="Please enter name" Display="Dynamic" />
                                                        </td>
                                                    </tr>
                                                    
                                                </table>
                                            </td>
                                            <td align="right" style="width: 25%; padding-left: 10px;">
                                                <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="No Photo"
                                                    ToolTip="No Photo" Width="90px" Height="110px" ResizeMode="Fit"  />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <div style="float: left; width: 160px;">
                                                    <asp:Button ID="btnPerformInsert" runat="server" Text="Insert" CommandName="PerformInsert" />
                                                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false" />
                                                </div>
                                                <telerik:RadUpload ID="ruCustomerImage" runat="server" AllowedFileExtensions=".jpg,.jpeg,.gif,.png"
                                                    MaxFileSize="1000000" ControlObjectsVisibility="None" InputSize="12" Width="160px"
                                                    Style="float: right" />
                                                <div style="clear: both" />
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </InsertItemTemplate>
                            <EmptyDataTemplate>
                                <fieldset style="width: 800px">
                                    <legend>Customers</legend>No records for customers available.
                                </fieldset>
                            </EmptyDataTemplate>
                        </telerik:RadListView>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Users" 
        Select="it.[ID], it.[Login], it.[Photo]">
    </asp:EntityDataSource>
</asp:Content>

